package com.dc.chat.config;

import com.dc.chat.interceptor.security.BackInterceptor;
import com.dc.chat.interceptor.security.SecurityInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import javax.annotation.Resource;

@Configuration
public class MvcConfig extends WebMvcConfigurationSupport {
    @Resource
    SecurityInterceptor securityInterceptor;
    @Resource
    BackInterceptor backInterceptor;
    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(securityInterceptor).addPathPatterns("/**");
        registry.addInterceptor(backInterceptor).addPathPatterns("/**");
    }
}
